UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPAJAOQhGvn8BmuZ9J4PYEoNQ1bAbJf83vsKJWQAlnk=' 
WHERE 
  key_id = '14ad5b0a2fb0d1fa530ba11ad89ec0dbba801b209c2f5fc7d78ca8ab4e8b6c91' 
  AND (
    token = 'nPAJAOQhGvn8BmuZ9J4PYEoNQ1bAbJf83vsKJWQAlnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044