UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'amRao3lUZNKffv+vlmG/c2yMArSDIdd+iY7q35WnpKQ=' 
WHERE 
  key_id = '552b0e9705f5c200f042036965e9e4f52d45c90b48700a662f6cadd1f9fadbc2' 
  AND (
    token = 'amRao3lUZNKffv+vlmG/c2yMArSDIdd+iY7q35WnpKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015