UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QMglvehEHVU4Aim7X2PcbpdzIXVdffHZzxwfNTyMWu8=' 
WHERE 
  key_id = '21eb05b82d43f0fb486177fb71b18d181f1dbeccb9e8b3b963c3b0e5b02b9b56' 
  AND (
    token = 'QMglvehEHVU4Aim7X2PcbpdzIXVdffHZzxwfNTyMWu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068