UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+liHN5J8t3G1BQais1Mi36B8xlyvfLJGKN6iYICVp7o=' 
WHERE 
  key_id = 'f933d19d8bcaf72a08595a244df1efd28d940aad06bee1cad85a09e44c36a57d' 
  AND (
    token = '+liHN5J8t3G1BQais1Mi36B8xlyvfLJGKN6iYICVp7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024