UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A/C5KfWzwp/GP0abBC/fmmhFk6V3jAJEZ651YL6Hdqk=' 
WHERE 
  key_id = 'f7ed00b46ee54d8055f37e4fe0f25bd300097631dc99e9f83176d64f9731d1da' 
  AND (
    token = 'A/C5KfWzwp/GP0abBC/fmmhFk6V3jAJEZ651YL6Hdqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033