UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u8xHdZdy2cBSy3BEUMqL4TTSGabYh5ZRROPNJGtcTH4=' 
WHERE 
  key_id = '30884928040d70f91e93d4317d65ef49a22100aef446c0451c641849351a9148' 
  AND (
    token = 'u8xHdZdy2cBSy3BEUMqL4TTSGabYh5ZRROPNJGtcTH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00110