UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eHNG9yvhnE5nSWq/ekkvBsDcQ/7cVIebB0PKCLfPk/o=' 
WHERE 
  key_id = '826bf18187b7100de8dd815de2ae744ba66683943aec1a8b74d0c72973288738' 
  AND (
    token = 'eHNG9yvhnE5nSWq/ekkvBsDcQ/7cVIebB0PKCLfPk/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029