UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm2EP+jOhcAVmbFGdPkxn8Bmna69GirPZVC07GwXdWQU=' 
WHERE 
  key_id = '48bb450ce451c141cd304d9a7d4ea5702005992938e9eb66b0601ce535857850' 
  AND (
    token = 'm2EP+jOhcAVmbFGdPkxn8Bmna69GirPZVC07GwXdWQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047