UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2YCO/ngeud4IaQnrwrymdIxLiqEXV7I7znWlSZsVkQY=' 
WHERE 
  key_id = 'aec2ba9ed5ede1b84805c6daadee9ecc4c0c1c787413b1e1103e0f51ea7a2caa' 
  AND (
    token = '2YCO/ngeud4IaQnrwrymdIxLiqEXV7I7znWlSZsVkQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019