UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhpLTISQbt1ZQR92jSFrBMF4uIoPIxLsWVsREJOepBs=' 
WHERE 
  key_id = '273805a07b00648ce9168da14c556742d6a5134a9f47a38787e1342bc8046e81' 
  AND (
    token = 'IhpLTISQbt1ZQR92jSFrBMF4uIoPIxLsWVsREJOepBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032