UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sEVZUXKo6/Nx9QBshiK3eAYpwPxKSrdfkx89tizywak=' 
WHERE 
  key_id = '03817accda7c00e7fdc096186b6aac98ad4555a1302bfcada4edff6ada750820' 
  AND (
    token = 'sEVZUXKo6/Nx9QBshiK3eAYpwPxKSrdfkx89tizywak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030