UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mZQ576AJrJaoAwTiHq9qEJYjKONS3M624fsRL4kBLaY=' 
WHERE 
  key_id = '4be6d97cefdc54864beb4080364126dc45008554f1c47aa5de0c95dde59d2cca' 
  AND (
    token = 'mZQ576AJrJaoAwTiHq9qEJYjKONS3M624fsRL4kBLaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033