UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lYOHpT1o7z9jOK+6GIdDSDUgCueh0Vxo5fc5t6uMi6E=' 
WHERE 
  key_id = '05b11a54e9a60dd9a62adce916341f6fc183b7710ff80df66cf627309c78df70' 
  AND (
    token = 'lYOHpT1o7z9jOK+6GIdDSDUgCueh0Vxo5fc5t6uMi6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040