UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4WeKs+vzK7nru0l0kP2vlEG9lVIKoyuRWk6fGIVc0k=' 
WHERE 
  key_id = 'acee75404d87a544a4425c9b9dc26af3037d42a88af5d600ac7046e563408c2d' 
  AND (
    token = 'Q4WeKs+vzK7nru0l0kP2vlEG9lVIKoyuRWk6fGIVc0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041