UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OQFw/tznp6TlpYgn6ToE8yQFY3ncZ8gLIdK1zG4UIWY=' 
WHERE 
  key_id = '39e14b123850371826e6bae90302836cf53d1cd5c37bb07715b67257792f195b' 
  AND (
    token = 'OQFw/tznp6TlpYgn6ToE8yQFY3ncZ8gLIdK1zG4UIWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061