UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GWNSBE9+hMHAbgG7LTtA+vvUhfBa6bhMGDWWm/CUl4I=' 
WHERE 
  key_id = '427dd705b276d544bac66a86a80e3a6cf88075bc675fb23b3446fd89093fcba1' 
  AND (
    token = 'GWNSBE9+hMHAbgG7LTtA+vvUhfBa6bhMGDWWm/CUl4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023