UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IvROHktHWWFNNFBquhWLEGR4BbT6kDqVP6UhstLxB9E=' 
WHERE 
  key_id = 'd091d0bf0830235e0e3a29fb355873ac6e5959fd0d81d24355987b02a1321659' 
  AND (
    token = 'IvROHktHWWFNNFBquhWLEGR4BbT6kDqVP6UhstLxB9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035