UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uWnXu4DqjtTZ5b6IjtbEApMIpYdWY/cavaWHztsV8Qg=' 
WHERE 
  key_id = '54d6d6f0db008f07447585b2ee5aae95a3c9bf1789ecf0c8c8d3280a14ca414c' 
  AND (
    token = 'uWnXu4DqjtTZ5b6IjtbEApMIpYdWY/cavaWHztsV8Qg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019