UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zMkKwOshYGrAymp4eGMRauWjy1z+sxjIiW/5EPHEeLc=' 
WHERE 
  key_id = '8e08eb278613e7c55e3dd1d243accc9f385a7d557a718a63d4dd6d8a17acdb6a' 
  AND (
    token = 'zMkKwOshYGrAymp4eGMRauWjy1z+sxjIiW/5EPHEeLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039