UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EKn/oZAqdoGwNBrI2XpxDF3ztvfuu8VvqOrEwcpFxQE=' 
WHERE 
  key_id = '4b063b9e2301da965e285b856fc569214c09fe86d091a54dde8a94ccc23d9240' 
  AND (
    token = 'EKn/oZAqdoGwNBrI2XpxDF3ztvfuu8VvqOrEwcpFxQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031