UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TxPJ33P3luAZnT7diKJQSRUaMIlXvo8yqmAZec5AHbI=' 
WHERE 
  key_id = '6fc66ca144c6a9a8ae32286729f638d08d30f2afe36286bacb53312274065385' 
  AND (
    token = 'TxPJ33P3luAZnT7diKJQSRUaMIlXvo8yqmAZec5AHbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045