UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+HaMFjId21RYxmqsfMt4feTDB8whl604WDpNUFcpXas=' 
WHERE 
  key_id = 'bfc61356f8213779241e81c321fa50a0912451c58fbf3126441fb9e6b4298635' 
  AND (
    token = '+HaMFjId21RYxmqsfMt4feTDB8whl604WDpNUFcpXas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023