UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'az4Q/2Km1z2NYvNhLgXaM2/5f1Yu91aJPevlKeF9A9E=' 
WHERE 
  key_id = '4c37d17f2c88f297d416e54d7b7a13867343e4fda1eb00105753fc49a0d04344' 
  AND (
    token = 'az4Q/2Km1z2NYvNhLgXaM2/5f1Yu91aJPevlKeF9A9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031