UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4co41O25DAXipG2N3UsFQEQgg4+cP2l+NZel7kfzYDU=' 
WHERE 
  key_id = '7bfaeffd558859f34e6e64d26f9f4b69a6e40ba46b5a771936daa2aed741c621' 
  AND (
    token = '4co41O25DAXipG2N3UsFQEQgg4+cP2l+NZel7kfzYDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029