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

Query time 0.00022