UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X68fIvAtXQnDsgtjMOvStlE+0f6JUlUefzuoEOMOPFg=' 
WHERE 
  key_id = '274a612157739711d77dc783582872161cf139db4ef6185e0317f8bdd9034e7e' 
  AND (
    token = 'X68fIvAtXQnDsgtjMOvStlE+0f6JUlUefzuoEOMOPFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051