UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EFU7u5vRd+Pk2AqJVrROBLdBOAK0etsk5J0G8hPquqY=' 
WHERE 
  key_id = '3ba1ac42c5bedef37b7c328fa63783a85e75158db9982ad5c287714f819f16d3' 
  AND (
    token = 'EFU7u5vRd+Pk2AqJVrROBLdBOAK0etsk5J0G8hPquqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029