UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WD3l+vrN256Q02E6yx5aqOii/1fKr2+mA39F2b8Kw7A=' 
WHERE 
  key_id = '74bd8fdeda31be79508747fb3ce13ed0880feab3d794918be7790b02c549a848' 
  AND (
    token = 'WD3l+vrN256Q02E6yx5aqOii/1fKr2+mA39F2b8Kw7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027