UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Uc0xS2trYPgJMJdTvLeDSP0AxTrBULVYaUXxYEZU4U=' 
WHERE 
  key_id = '4a81cd815c3e9b9ae1fe318023d4e752d2911e7ac526ac942ba0d78e7275582b' 
  AND (
    token = '5Uc0xS2trYPgJMJdTvLeDSP0AxTrBULVYaUXxYEZU4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032