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

Query time 0.00016