UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hdjn8ocVY9Ak9XA/ernpo+q0NtEHYa4y0l0wmchYHOQ=' 
WHERE 
  key_id = '36cd34bc56ae91fc0587f52da5ee52669450d929382ac7a5391854ca5e079320' 
  AND (
    token = 'Hdjn8ocVY9Ak9XA/ernpo+q0NtEHYa4y0l0wmchYHOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036