UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sh6nTRT5x9leNx/bpZSPaNFhCL5wVN337HfnrIBJjRU=' 
WHERE 
  key_id = '29c7222515a7a64b94f43171a672a343614758ca49721b3781ed3f6525da01f7' 
  AND (
    token = 'Sh6nTRT5x9leNx/bpZSPaNFhCL5wVN337HfnrIBJjRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018