UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ab9WqMz3kQiK0JBs0yXxVYB0oxeJSMKP8WXDzYn1noA=' 
WHERE 
  key_id = '19abfd19ed9d73ce79397e6f65d462220086c9728af7bace26eda4b9860c2d10' 
  AND (
    token = 'ab9WqMz3kQiK0JBs0yXxVYB0oxeJSMKP8WXDzYn1noA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033