UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ayXbq5ofHrv08zcLRZNspe2yHlHzlEVn6wIsWJIyGl8=' 
WHERE 
  key_id = '1bba7f744b3606ca4e99148fa693c7875d631c08cf87c928983a974cdb5b5bca' 
  AND (
    token = 'ayXbq5ofHrv08zcLRZNspe2yHlHzlEVn6wIsWJIyGl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033