UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8klFSNE3uQFrKZrmWKa80PtHJTpqvSl8FUete5YkTtM=' 
WHERE 
  key_id = '1d82605a3567eb3c505b7c4cd1e882a59d30c6f6d07eb5f4d3b5649a8a28ee6f' 
  AND (
    token = '8klFSNE3uQFrKZrmWKa80PtHJTpqvSl8FUete5YkTtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031