UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zG95ysmXPqk9I/oB607ZdgaAxSqRXzvrkI5d48wtHqw=' 
WHERE 
  key_id = '35bd502a25be0af2171288dbd5020d7c45a2ec40b86aafb691d7e641ae599e44' 
  AND (
    token = 'zG95ysmXPqk9I/oB607ZdgaAxSqRXzvrkI5d48wtHqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087