UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DXn2D5s4TX8/OJGEqimfpLGKpWSbOx25DZ9StgIzrbg=' 
WHERE 
  key_id = 'bb83589c5016d0799e1a29a32da283027c2c645ecbf05347ccfe14266847a85e' 
  AND (
    token = 'DXn2D5s4TX8/OJGEqimfpLGKpWSbOx25DZ9StgIzrbg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021