UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OWpKUESluln9KhT5U20fxGv98/wrIELGJlt6Vq8HVJM=' 
WHERE 
  key_id = '32ab5e9f5e5decbde4d23f431fdc9c069372d88e81ac14de6fa8c9477233949f' 
  AND (
    token = 'OWpKUESluln9KhT5U20fxGv98/wrIELGJlt6Vq8HVJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042