UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pz5NqUnOFpabEMpp8mEkkItf4tIi/Fuo0GHkFDRm5/0=' 
WHERE 
  key_id = 'edcbee5b30c44bad27fb965655f1f428ee86164a03136067ec03a76d32300fb7' 
  AND (
    token = 'pz5NqUnOFpabEMpp8mEkkItf4tIi/Fuo0GHkFDRm5/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051