UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2oFEkGfkfYVNfcNJbkpn3fnI9MnWaeqaOJdrjomI2dA=' 
WHERE 
  key_id = '82425e57e20eddf3aa9b146638aa6d4b6d7b37f4bf74dcc85cbe8734d17199bc' 
  AND (
    token = '2oFEkGfkfYVNfcNJbkpn3fnI9MnWaeqaOJdrjomI2dA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052