UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUziNRkzlQU46aCGRbSVv9VR+E/3Wh+dZtpS7c3h+08=' 
WHERE 
  key_id = '78b6b692410a660da5e262028a8b13ba447e48519a57b75a3788547579b02870' 
  AND (
    token = 'EUziNRkzlQU46aCGRbSVv9VR+E/3Wh+dZtpS7c3h+08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042