UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D7eoUQo8l2MLsyIrj7IzBHjEWdU3qMgpOGzStzwVC1I=' 
WHERE 
  key_id = '2af1e3bfdc3587c8a80cad3634e0c78a9b06542e3c5f86c6d5fbd429a1e74a03' 
  AND (
    token = 'D7eoUQo8l2MLsyIrj7IzBHjEWdU3qMgpOGzStzwVC1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035