UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gv/PxJmvzNT7ZJUtHWhED0F8RO4/f07vM0i7mPCIGhU=' 
WHERE 
  key_id = 'd83adce3c558ad214fa31cd446550616813da296969ae51dca800a0069349cf1' 
  AND (
    token = 'gv/PxJmvzNT7ZJUtHWhED0F8RO4/f07vM0i7mPCIGhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030