UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oQMYfycQIEP37JkCtx8y22yhxbp70Rk8czpyRVZezZU=' 
WHERE 
  key_id = '81674533eeaf1f5ea735d111eae25228a1cd99b8b2730d9653555393532653cc' 
  AND (
    token = 'oQMYfycQIEP37JkCtx8y22yhxbp70Rk8czpyRVZezZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048